#include<bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
	int x;
	cin >> x;
	int a[10][10];
	for(int i = 1; i <= 5; i ++ ) {
		for(int j = 1; j <= 5; j ++ ) {
			a[i][j] = 1;
		}
	}
	if(x != - 1) {
		a[1][1] = x + 1;
		a[3][3] = 2;
	} else {
		a[1][1] = 1;
		a[1][3] = 2;
		a[3][1] = 2;
		a[3][2] = 1;
		a[3][3] = 2;
	}
	for(int i = 1; i <= 3; i ++ ) {
		for(int j = 1; j <= 3; j ++ ) {
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	return 0;
}

